package com.seezoon.admin.modules.sys.service;

import com.seezoon.admin.framework.service.IBaseService;
import com.seezoon.admin.modules.sys.dto.RoleAssignAo;
import com.seezoon.dao.modules.sys.entity.SysParam;
import com.seezoon.dao.modules.sys.entity.SysRole;
import org.springframework.transaction.annotation.Transactional;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author 黎小荣
 * @since 2023/3/22
 */
public interface ISysRoleService extends IBaseService<SysRole> {
    @Transactional(readOnly = true)
    SysRole findByCode(@NotBlank String code);

    @Transactional(readOnly = true)
    SysRole findByName(@NotBlank String name);

    @Transactional(readOnly = true)
    List<SysRole> findAll();

    int assign(@Valid @NotNull RoleAssignAo roleAssignAo);

    @Transactional(readOnly = true)
    List<SysRole> findByUserId(@NotNull Integer userId);
}
